#include "CQueryTimer.h"



CQueryTimer::~CQueryTimer(void)
{
}

void CQueryTimer::Init( void )
{
	QueryPerformanceFrequency(&litmp);
	dfFreq = (double)litmp.QuadPart;
	startFlag = 0;
}

void CQueryTimer::Start( void )
{
	QueryPerformanceCounter(&litmp);
	QPart1 = litmp.QuadPart;
	startFlag = 1;
}

double CQueryTimer::GetTimeInterval( void )
{
	if(startFlag == 0)
		return 0;

	QueryPerformanceCounter(&litmp);
	QPart2 = litmp.QuadPart;
	dfMinus = (double)(QPart2 - QPart1);
	dfTim = dfMinus / dfFreq;
	return dfTim;
}